const Express = require('express')
const proxy = require('http-proxy-middleware')
const proxyMiddleware = proxy.createProxyMiddleware({
  target: 'https://registry.npmmirror.com',
  changeOrigin: true,
  ws: true,
  pathRewrite: (path) => path.replace(/\/electron\/v?/, '/electron/v')
})
const app = Express()
app.use(proxyMiddleware)
app.listen(80)
console.log(`http://localhost/-/binary/electron/`)
